import xadmin
from students_cost.models import StudentsCost

class StudentsCostAdmin():
    list_display = [ 'get_name','get_school','get_grand','get_class','get_student_id','get_student_id','get_id_number','get_pay_money','get_pay_times','get_pay_order','get_pay_statu','pay_money','pay_times','pay_order','pay_statu']
    def get_name(self, obj):
        return '%s ' % obj.stuinfo.name

    get_name.short_description = '姓名'

    def get_school(self, obj):
        return '%s ' % obj.stuinfo.school

    get_school.short_description = '学校'

    def get_grand(self, obj):
        return '%s ' % obj.stuinfo.grade

    get_grand.short_description = '年级'

    def get_class(self, obj):
        return '%s ' % obj.stuinfo.the_class

    get_class.short_description = '班级'

    def get_student_id(self, obj):
        return '%s' % obj.stuinfo.student_id

    get_student_id.short_description = '学号'

    def get_id_number(self, obj):
        return '%s' % obj.stuinfo.id_number

    get_id_number.short_description = '身份证号'
    def get_pay_money(self, obj):
        return '%s' % obj.pay_info.pay_money

    get_pay_money.short_description = '缴费金额'
    def get_pay_times(self, obj):
        return '%s' % obj.pay_info.pay_times

    get_pay_times.short_description = '缴费时间'
    def get_pay_order(self, obj):
        return '%s' % obj.pay_info.pay_order

    get_pay_order.short_description = '缴费订单号'

    def get_pay_statu(self, obj):
        return '%s' % obj.pay_info.pay_statu

    get_pay_statu.short_description = '缴费状态'
xadmin.site.register(StudentsCost, StudentsCostAdmin)